<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="common/include :: header('结算单明细列表')" />
</head>
<body>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form1">
                <div class="col-sm-12" >
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">客户姓名：</label>
                            <label class="col-sm-6 control-label">[[${statement.customerName}]]</label>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">联系电话：</label>
                            <label class="col-sm-6 control-label">[[${statement.customerPhone}]]</label>
                        </div>
                    </div>
                </div>

                <div class="col-sm-12" >
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">车牌号码：</label>
                            <label class="col-sm-6 control-label">[[${statement.licensePlate}]]</label>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">汽车类型：</label>
                            <label class="col-sm-6 control-label">[[${statement.carSeries}]]</label>
                        </div>
                    </div>
                </div>

                <div class="col-sm-12" >
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">服务类型：</label>
                            <label class="col-sm-6 control-label">[[${@dict.getLabel('si_service_catalog',statement.serviceType)}]]</label>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">到店时间：</label>
                            <label class="col-sm-6 control-label" th:text="${#dates.format(statement.actualArrivalTime, 'yyyy-MM-dd HH:mm')}"></label>
                        </div>
                    </div>
                </div>

                <div class="col-sm-12" >
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">总消费金额：</label>
                            <label class="col-sm-6 control-label" id="totalAmount">[[${statement.totalAmount}]]</label>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">实付价格：</label>
                            <label class="col-sm-6 control-label" id="actuallyPaid">[[${statement.totalAmount-statement.discountAmount}]]</label>
                        </div>
                    </div>
                </div>

                <div class="col-sm-12" >
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-6 control-label">优惠价格：</label>

                            <label class="col-sm-6 control-label">[[${statement.discountAmount}]] </label>
                        </div>
                    </div>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="MyTools" role="group">
            <a class="btn btn-success" onclick="saveItem()" shiro:hasPermission="system:post:add">
                <i class="fa fa-plus"></i> 打印
            </a>
            <a class="btn btn-warning" onclick="payFun()" shiro:hasPermission="system:post:add">
                <i class="fa fa-plus"></i> 导出
            </a>
        </div>

        <!--注册左边的表格-->
        <div class="col-sm-12 select-table table-striped">
            <table id="statementItemTable">
            </table>
        </div>
    </div>
</div>
</body>

<th:block th:include="common/include :: footer" /> <!--引入分页-->
<th:block th:include="common/include :: layout-latest" />

<script>
    // OUTER-LAYOUT
    /*$('body').layout({
        east__size:	'30%',
    });*/

    $(function() {
        var statementId = [[${statement.id}]];
        console.log(statementId);
        var options = {
            id: "statementItemTable", //左边表格
            toolbar: "MyTools", //左边的工具栏
            uniqueId: "itemId", //左边表的id
            url: "/business/statementItem/query?statementId="+statementId,
            columns: [
                {
                    field: 'id',
                    title: '客户id',
                    visible: false   //隐藏
                },
                {
                    field: 'itemId',
                    title: '单项id',
                    visible: false
                },
                {
                    field: 'itemName',
                    title: '服务项名称',
                    sortable: true
                },
                {
                    field: 'itemPrice',
                    title: '服务项原价',
                    sortable: true
                },

                {
                    field: 'itemQuantity',
                    title: '购买数量',
                    sortable: true
                }]
        };
        $.table.init(options);
    });
</script>

</html>